package com.smdd.project.service.impl;

import com.smdd.project.dao.CardInfoRepository;
import com.smdd.project.entity.CardInfo;
import com.smdd.project.service.TradeService;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName TradeServiceImpl
 * @Description TODO
 * @Author wyp
 * @Date 2023/7/7 17:32
 * @Version 1.0
 */
@Service
public class TradeServiceImpl implements TradeService {

    private static final Logger logger = LoggerFactory.getLogger(TradeServiceImpl.class);

    private final CardInfoRepository cardInfoRepository;

    @Autowired
    public TradeServiceImpl(CardInfoRepository cardInfoRepository) {
        this.cardInfoRepository = cardInfoRepository;
    }

    @Override
    public CardInfo findByCardInfo(String id) {
        logger.info("查询卡号信息");
        return this.cardInfoRepository.findById(Long.parseLong(id)).orElse(null);
    }
}
